package com.chuangjiangx.member.common.utils.AIFace;

public enum AiExceptionCode {

    SUCCESS("0000", "成功"),
    UPDATE_FACE_ERROR("0001", "更新人脸异常"),
    ADD_FACE_ERROR("0002", "新增人脸异常"),
    RECOGNITION_ERROR("0003", "识别异常"),
    BIOASSAY_FACE_ERROR("0004", "活体检测异常"),
    INPUT_FACE_PRE_PRECESSING_ERROR("0005", "采集人脸预处理异常"),
    UPDATE_INPUT_FACE_ERROR("0006", "更新采集人脸异常"),
    FACE_INPUT_ERROR("0007", "人脸录入采集异常"),

    ARGS_LOSS("2001", "接口请求参数不全"),
    MEMBER_LOSS("2002", "该face_id对应会员信息不存在"),
    ARGS_ERROR("2003", "请求参数错误"),
    MERCHANT_LOSS("2005", "商户信息不存在"),
    BIOASSAY_ERROR("2006", "活体检测失败"),
    BIOASSAY_VEDIO_ERROR("2008", "活体检测失败"),
    UPDATE_FACE_RECOGNITION_ERROR("2009", "人脸更新人脸匹配度不足"),
    INPUT_FACE_ACTION_ERROR("2010", "人脸采集动作不匹配");



    public String code;
    public String msg;
    AiExceptionCode(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static AiExceptionCode get(String code) {
        for (AiExceptionCode aiCode : AiExceptionCode.values()) {
            if (code.equals(aiCode.code)) {
                return aiCode;
            }
        }
        return null;
    }

}
